package com.ruowei.common.error;

import org.zalando.problem.AbstractThrowableProblem;
import org.zalando.problem.Status;

import java.util.HashMap;
import java.util.Map;

public class StorageException extends AbstractThrowableProblem {

    private static final long serialVersionUID = 1L;

    public StorageException(String message) {
        super(null, null, Status.BAD_REQUEST, null, null, null, getParameters(message));
    }

    private static Map<String, Object> getParameters(String message) {
        Map<String, Object> parameters = new HashMap<>();
        parameters.put(ExceptionTranslator.MESSAGE_KEY, message);
        return parameters;
    }
}
